package com.tulingxueyuan.order.controller;

import com.tulingxueyuan.order.fegin.ProductFeginService;
import com.tulingxueyuan.order.fegin.StockFeginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: MI
 * @Date: 2021/11/2/0:00
 * @Description:
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    StockFeginService stockFeginService;

    @Autowired
    ProductFeginService productFeginService;

    @RequestMapping("/add")
    public String add() {
        System.out.println("下单成功");
        String msg = stockFeginService.reduct();
        System.out.println(productFeginService.get(1));
        return "hello fegin!" + msg;
    }

}
